# Find Qt
list(APPEND QtLibs)
list(APPEND QtIncludes)

function(FindQt QtVersion QtComponents)
	find_package(Qt${QtVersion} COMPONENTS ${QtComponents} REQUIRED)
	set(QT_FULL Qt${QtVersion})

	list(APPEND INCLUDES)
	list(APPEND LIBS)

	if(Qt${QtVersion}_FOUND)
		foreach(QtComponent ${QtComponents})
			set(CURRENT_INCLUDE  ${${QT_FULL}${QtComponent}_INCLUDE_DIRS})
			list(APPEND INCLUDES ${CURRENT_INCLUDE})

			set(CURRENT_LIB  ${${QT_FULL}${QtComponent}_LIBRARIES})
			list(APPEND LIBS ${CURRENT_LIB})
		endforeach()
		set(QtIncludes ${QtIncludes} ${INCLUDES} PARENT_SCOPE)
		set(QtLibs ${QtLibs} ${LIBS} PARENT_SCOPE)
	endif()
endfunction()